import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
// 引入全局样式
import '@/assets/css/global.css'
// 引入 vue-table-with-tree-grid
import TreeTable from 'vue-table-with-tree-grid'

// 引入axios
import axios from 'axios'
// 配置axios默认路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// 配置axios拦截器
axios.interceptors.request.use((config) => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

Vue.prototype.$http = axios

Vue.config.productionTip = false

// 注册 vue-table-with-tree-grid 插件
Vue.component('tree-table')

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
